package com.example.mansystem.service;

import com.example.mansystem.Activiti.ProcessImageManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.InputStream;

@Service
public class ProcessImageService {
    ProcessImageManager processImageManager;

    @Autowired
    public ProcessImageService(ProcessImageManager processImageManager) {
        this.processImageManager = processImageManager;
    }

    /**
     * 根据流程实例Id获取流程图
     *
     * @param procInstId 流程实例id
     * @return inputStream
     * @throws Exception exception
     */
    public InputStream getFlowImgByProcInstId(String procInstId) throws Exception {
        return processImageManager.getFlowImgByProcInstId(procInstId);
    }

    public InputStream getImgByProcessDefinitionKey(String processDefinitionKey) throws  Exception{
        return processImageManager.getImgByProcessDefinitionKey(processDefinitionKey);
    }
}
